<?php

/**
* Здесь находится вся информация о пользователе
*/

class User_Model
{

private $id;   
private $login ;
private $firstName ;
private $secondName ;
private $email ;
private $password ;
private $phone ;
private $birthday ;
private $picture ;
private $gender ;
private $timeCreated ;
private $timeEdited ;
private $rights ;   


    public function __construct(array $arr = null)
    {  
        if (is_array($arr)){
              $prop = $this->getArray();
              foreach($arr  as $k=>$v){
              if (array_key_exists($k, $prop) == true){
                    $this->$k = $v;
                    }
              }
        }   
    }
 
    public function getId()
    {
       return $this->id; 
    }
    
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }
        
    public function getLogin()
    {
        return $this->login ;
    }
       
    public function setLogin($login)
    {
        $this->login = $login ;
        return $this;
    }
    
    
    public function getEmail()
    {
        return $this->email ;
    }
    
    
    public function setEmail($email)
    {
        $this->email = $email ;
        return $this;
    }
   
   
    public function getFirstName()
    {
        return $this->firstName;
    }   
   
   
    public function setFirstName($firstName)
    {
        $this->firstName = $firstName;
        return $this;
    }
    
    
    public function getSecondName()
    {
        return $this->secondName;
    }   
   
   
    /**
    * устанавливает фамилию пользователя
    * 
    * @param mixed $secondtName
    */
    public function setSecondName($secondName)
    {
        $this->secondName = $secondName;
        return $this;
    }
    
    public function getPassword()
    {
        return $this->password;
    }
    
    
    public function setPassword($password)
    {
        $this->password = $password;
        return $this;
    }
    
    public function getPhone()
    {
        return $this->phone;
    }
    
    public function setPhone($phone)
    {
        $this->phone = $phone;
        return $this;
    }
    
    public function getBirthday()
    {
        return $this->birthday;
    }
    
    public function setBirthday($birthday)
    {
        $this->birthday = $birthday;
        return $this;
    }
    
    public function getRights ()
    {
        return $this->rights;
    }
    
    public function setRights($rights)
    {
        $this->rights = $rights;
        return $this;
    }
    
    public function getPicture()
    {
       return $this->picture; 
    }
    
    public function setPicture()
    {
        $this->picture = $picture;
        return $this;
    }
    
    public function getGender()
    {
        return $this->gender;
    }
    
    public function setGender()
    {
        
    }
    
    public function getTimeCreated()
    {
       return $this->timeCreated; 
    }
    
    public function setTimeCreated($timeCreated)
    {
       $this->timeCreated = $timeCreated;
       return $this; 
    }
    
    public function getTimeEdited()
    {
        return $this->timeEdited;
    }
    
    public function setTimeEdited($timeEdited)
    {
       $this->timeEdited = $timeEdited;
       return $this; 
    }
    
    
    public function getArray()
    {
        $objArr = get_object_vars($this);
        return $objArr;
    }
}
